@use "./base/variables.scss" as *;
@use "./base/mixins.scss" as *;

.sct-container {
  width: 100%;
  table-layout: fixed;
}

.sct-render-wrapper {
  // position: relative;
}
.sct-main-wrapper {
  position: relative;
  overflow: hidden;
}

/** 表格边框*/
.sct-border {
  border: $sc-table-border;
  td,
  th {
    border: $sc-table-border;
  }
  // 第一列左边框0
  td:first-child,
  th:first-child {
    border-left: 0;
  }
  // 最后一列右边框0
  td:last-child,
  th:last-child {
    border-right: 0;
  }
  // body第一行 列头边框0
  tr:nth-child(1) {
    td,
    th {
      border-top: 0;
    }
  }
  // body最后行 列尾边框0
  tr:nth-last-child(1) {
    td {
      border-bottom: 0;
    }
  }
}

.sct-header,
.sct-body {
  width: 100%;
  border-spacing: 0;
  border-collapse: collapse;
  table-layout: fixed;
  td {
    padding: 5px 8px;
  }
  th {
    padding: 8px;
  }
}
/** 表头*/
.sct-header-wrapper {
  background-color: $sc-table-header-background-color;
  overflow: hidden;
  th:nth-last-of-type(1) {
    margin-right: 200px;
  }
}
// 固定表头间隔
.sct-header__spacing-right {
  padding-right: 15px;
  border-bottom: $sc-table-border;
  box-sizing: border-box;
}
.sct-right-fixed-wrapper__spacing-block {
  width: 15px;
  position: absolute;
  right: 0;
  top: 0;
  box-sizing: border-box;
  background-color: $sc-table-header-background-color;
  border-bottom: $sc-table-border;
}
/** 表体*/
.sct-body {
  background-color: #fff;
}
.sct-body-wrapper__scroll {
  overflow: auto;
}
.sct-body-wrapper__stripe {
  tr:nth-of-type(2n) {
    background-color: $sc-table-stripe-background-color;
  }
  tr:nth-of-type(2n + 1) {
    td {
      color: $sc-table-stripe-color;
    }
  }
}
/** 表列内连块显示*/
.sct-header-col__cell,
.sct-body-col__cell {
  display: inline-block;
  width: 100%;
}

/** 列表表对齐方式*/
@each $align in "left", "center", "right" {
  .sct-header-col__align-#{$align} {
    text-align: #{$align};
  }
  .sct-body-col__align-#{$align} {
    text-align: #{$align};
  }
}

/** 显示省略号或换行显示*/
.sct-col__cell-wrap {
  word-wrap: break-word;
}
.sct-col__cel-ellipsis {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/** 左边固定列*/
.sct-left-fixed-wrapper {
  position: absolute;
  left: 0;
  top: 0;
  overflow: hidden;
  overflow-y: auto;
  box-sizing: border-box;
  z-index: 1;
  box-shadow: 1px 0px 5px 1px $sc-border-color;
  .sct-body-wrapper {
    overflow: hidden;
    // &::-webkit-scrollbar {
    //   color: #ffffff00;
    // }
    // &::-webkit-scrollbar-thumb {
    //   background: transparent; //滚动条颜色
    // }
    // &::-webkit-scrollbar-track {
    //   background: #ffffff00; //背景颜色
    // }
  }
}
/** 右边固定列*/
.sct-right-fixed-wrapper {
  position: absolute;
  right: 15px;
  top: 0;
  box-shadow: -1px 0px 5px 1px $sc-border-color;
  box-sizing: border-box;
  z-index: 1;
  .sct-body-wrapper {
    overflow: hidden;
  }
}
